<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-10-18
 * Time: 13:59
 */
namespace app\manage\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Process extends Validate
{
    //定义验证规则
    protected $rule = [
        'title|流程审批标题'  => 'require',
        'group_id|团队Id'  => 'require',
        'first_post_id|岗位'   => 'require',
        'process_id|审批分类'   => 'require',
        'first_post_id|第一审批人' => 'require',
        'replace|替岗' => 'require',
        'status|状态' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'title.require' => '请输入标题',
        'group_id.require' => '请选择团队',
        'first_post_id.require' => '请选择岗位',
        'process_id.require' => '请选择审批分类',
        'first_user_id.require' => '请选择第一审批人',
        'replace.require' => '请选择是否需要替岗',
        'status.require' => '请选择状态',


    ];

    //定义验证场景
    protected $scene = [
        //更新
        'add'  =>  ['title','group_id','post_id','process_id','first_post_id','replace','status'],
    ];
}
